﻿using System.Collections.Generic;
using System.Web.Http;
using GarageManagement.Domain.Model;
using GarageManagement.Domain.Service.Contracts;

namespace GarageManagement.DistributedService.Controllers
{
    public class CustomerController : ApiController
    {
        private readonly ICustomerService customerService;

        public CustomerController(ICustomerService customerService)
        {
            this.customerService = customerService;
        }

        [HttpGet]
        public IList<Customer> GetCustomers()
        {
            return customerService.GetCustomers();
        }

        [HttpPost]
        public Customer Add(Customer customer)
        {
            return customerService.AddCustomer(customer);
        }
    }
}
